{extend name="public:base" /}


{block name="content"}
<!-- <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
  <legend></legend>
</fieldset> -->
<div class="layui-tab" lay-filter="test">
  <ul class="layui-tab-title">
    <li class="layui-this" lay-id="11">银行转账</li>
    <li lay-id="22">微信支付</li>
    <li lay-id="33">支付宝</li>
    <li lay-id="44">短信接口设置</li>
    <!--<li lay-id="55">订单管理</li> -->
  </ul>
  <div class="layui-tab-content">
    <div class="layui-tab-item layui-show">
        <div id="from" class="layui-form" data-url='{:url("Configure/save_config")}' >

        {foreach $list as $v}
            <div class="layui-form-item">
                <label class="layui-form-label">{$v['remark']? $v['remark'] : ''}</label>
                <div class="layui-input-inline">
                    <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                    <input type="text" name="{$v.id}-value" lay-verify="required" autocomplete="off" class="layui-input" value="{$v['value']? $v['value'] : ''}">
                </div>
            </div>
        {/foreach}

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            </div>
        </div>
        </div>
    </div>
    <div class="layui-tab-item">
        <div id="from" class="layui-form" data-url='{:url("Configure/save_config")}' >
            {foreach $weixin as $v}
            {if condition="$v['id'] eq 14"}        
                <!-- <div class="layui-form-item">
                    <label class="layui-form-label" style="width: 120px;">{$v['remark']? $v['remark'] : ''}</label>
                    <div class="layui-input-inline">
                        <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                    </div>
                    <div class="layui-input-block">
                        <input type="checkbox" {$v['value'] == 'on'? 'checked' : ''}  name="{$v.id}-value" lay-skin="switch" lay-filter="switchTest" lay-text="ON|OFF">
                    </div>
                </div> -->
            {else /}
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width: 120px;">{$v['remark']? $v['remark'] : ''}</label>
                    <div class="layui-input-inline">
                        <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                        <input style="width: 800px;" type="text" name="{$v.id}-value" lay-verify="required" autocomplete="off" class="layui-input" value="{$v['value']? $v['value'] : ''}">
                    </div>
                </div>
            {/if}
            {/foreach}

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                </div>
            </div>
        </div>
    </div>
    <div class="layui-tab-item">


        <div class="layui-collapse" lay-accordion="">
          <div class="layui-colla-item">
            <h2 class="layui-colla-title">支付宝电脑支付</h2>
            <div class="layui-colla-content layui-show">

                <div id="from" class="layui-form" data-url='{:url("Configure/save_config")}' >

                {foreach $alipay as $v}
                    <div class="layui-form-item">
                        <label class="layui-form-label">{$v['remark']? $v['remark'] : ''}</label>
                        <div class="layui-input-inline">
                            <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                            <input type="text" name="{$v.id}-value" lay-verify="required" autocomplete="off" class="layui-input" value="{$v['value']? $v['value'] : ''}">
                        </div>
                    </div>
                {/foreach}

                

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    </div>
                </div>
                </div>
                <a href="https://open.alipay.com" target="view_window">————支付宝支付申请————</a>
            </div>
          </div>
          <div class="layui-colla-item">
            <h2 class="layui-colla-title">支付宝手机支付</h2>
            <div class="layui-colla-content">
                
                <div id="from" class="layui-form" data-url='{:url("Configure/save_config")}' >
                {foreach $alipay_m as $v}
                    <div class="layui-form-item">
                        <label class="layui-form-label">{$v['remark']? $v['remark'] : ''}</label>
                        <div class="layui-input-inline">
                            <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                            <input type="text" name="{$v.id}-value" lay-verify="required" autocomplete="off" class="layui-input" value="{$v['value']? $v['value'] : ''}">
                        </div>
                    </div>
                {/foreach}

                

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                    </div>
                </div>
                </div>

                <a href="https://open.alipay.com" target="view_window">————支付宝支付申请————</a>
            </div>
          </div>
        </div>
    </div>
    <div class="layui-tab-item">
        <div id="from" class="layui-form" data-url='{:url("Configure/save_config")}' >

        {foreach $SMS as $v}
            <div class="layui-form-item">
                <label class="layui-form-label">{$v['remark']? $v['remark'] : ''}</label>
                <div class="layui-input-inline">
                    <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                        <input style="width: 800px;" type="text" name="{$v.id}-value" lay-verify="required" autocomplete="off" class="layui-input" value="{$v['value']? $v['value'] : ''}">
                </div>
            </div>
        {/foreach}

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            </div>
        </div>
        </div>
    </div>
    <!-- <div class="layui-tab-item">内容5</div> -->
  </div>
</div>


<!-- <div style="width: 500px;height: 250px; padding-top: 30px">
    <div id="from" class="layui-form" data-url='{:url("Configure/save_config")}' >

        {foreach $list as $v}
            <div class="layui-form-item">
                <label class="layui-form-label">{$v['remark']? $v['remark'] : ''}</label>
                <div class="layui-input-inline">
                    <input type="hidden" name="{$v.id}-id" value="{$v['id']? $v['id'] : ''}">
                    <input type="text" name="{$v.id}-value" lay-verify="required" autocomplete="off" class="layui-input" value="{$v['value']? $v['value'] : ''}">
                </div>
            </div>
        {/foreach}

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            </div>
        </div>
    </div>
</div> -->

{/block}

{block name="javascript"}
<!-- <script src="//res.layui.com/layui/dist/layui.js" charset="utf-8"></script> -->

<script type="text/javascript">
    layui.use(['form', 'layedit', 'laydate','element'], function(){
        var form = layui.form;
        var layer = layui.layer;
        var element = layui.element;

        //Hash地址的定位
        var layid = location.hash.replace(/^#test=/, '');
        element.tabChange('test', layid);

        element.on('tab(test)', function(elem){
            location.hash = 'test='+ $(this).attr('lay-id');
        });


        //监听提交
        form.on('submit(formDemo)', function(data){
            var url = $("#from").attr("data-url");
            $.ajax({
                type: 'POST',
                url: url,
                dataType: 'json',
                data: data.field,
                success: function (da) {
                    layer.open({
                        content: da.msg//
                        ,yes: function(index, layero){
                            layer.close(index);
                        }
                        ,time:3000
                    });
                }
            });

            return false;
        });

        

    });
</script>
{/block}